<template>
  <ul>
    <li v-for="(item, index) in items" :key="index">
      <div class="box">
        <img :src="item.image" :alt="item.name">
        <div class="content">
          <h4>{{ item.name }}</h4>
          <p>
            {{ item.message }}
            <br>
            <span>{{ item.time }}</span>
          </p>
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  name: 'GlassmorphismList',
  data()
  {
    return {
      items: [
        { image: require('@/assets/admin.jpg'), name: '系统升级通知', message: '为了提升系统性能，我们将于2025年10月10日凌晨2:00至4:00进行系统升级。升级期间系统将暂停服务，请提前做好安排。', time: '2025-2-9' },
        { image: require('@/assets/admin.jpg'), name: '取件码使用说明', message: '取件码是您取件的唯一凭证，请妥善保管。取件时请在快递柜输入取件码，系统将自动打开对应柜门。', time: '2025-2-9' },
        { image: require('@/assets/admin.jpg'), name: '国庆节放假通知', message: '根据国家法定节假日安排，2025年10月1日至10月7日为国庆节假期。假期期间快递柜正常运营，祝大家节日愉快！', time: '2025-2-9' },
        { image: require('@/assets/admin.jpg'), name: '劳动节放假通知', message: '根据国家法定节假日安排，2025年5月1日至5月6日为国庆节假期。假期期间快递柜正常运营，祝大家节日愉快！', time: '2025-2-9' }
      ]
    }
  }
}
</script>

<style scoped>
*::after, *::before {
  box-sizing: border-box;
}

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #0f222f;
}

ul {
  position: relative;
  transform-style: preserve-3d;
  perspective: 500px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: .5s;
}

ul:hover {
  gap: 30px;
}

ul li {
  position: relative;
  list-style: none;
  width: 600px;
  padding: 15px;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  transition: .5s;
  box-shadow: 0 -15px 25px rgba(0,0,0,.3);
}

ul li:nth-child(1) {
  transform: translateZ(-75px) translate(-80px, -40px) rotate(-15deg);
}

ul li:nth-child(2) {
  transform: translateZ(80px) translate(50px, 20px) rotate(5deg);
}

ul li:nth-child(3) {
  transform: translateZ(75px) translate(0px, -30px) rotate(-25deg);
}

ul li:nth-child(4) {
  transform: translateZ(20px) translate(-100px, -25px) rotate(15deg);
}

ul:hover li {
  transform: translateZ(0) translate(0, 0) rotate(0deg);
}

ul li .box {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  transition: .5s;
}

ul li:hover .box {
  transform: translateX(-50px);
}

ul li .box img {
  max-width: 70px;
  border-radius: 5px;
  height: 63px;
  object-fit: cover;
}

ul li .content {
  width: 100%;
  cursor: pointer;
}

ul li .content h4 {
  font-weight: 600;
  color: #aaa;
  transition: .5s;
}

ul li .content p {
  position: relative;
  width: 100%;
  line-height: 1em;
  color: #aaa;
  transition: .5s;
}

ul li .content p span {
  position: absolute;
  top: 60px;
  right: 0;
  color: #aaa;
  transition: .5s;
  font-size: .75em;
}

ul li:hover .content h4,
ul li:hover .content p,
ul li:hover .content p span {
  color: #FFF
}

</style>
